import React from 'react'

import dva from './utils/dva'
import Router, { routerMiddleware } from './router'

import appModel from './models/app'
import routerModel from './models/router'
import loginModel from './models/login'
import signUpModel from './models/signup'
import uploadModel from './models/upload'
import searchModel from './models/serach'
import userModel from './models/user'

const app = dva({
  initialState: {},
  models: [appModel, routerModel, loginModel, signUpModel, uploadModel, searchModel, userModel],
  onAction: [routerMiddleware],
  onError(e) {
    console.log('onError', e)
  }
})

const App = app.start(<Router />)
export default App
